#include <my_header.h>

/* Usage: ./8_sigaction_SA_NODEFER */
void func(int sig_value){
    printf("before: sig_value %d \n", sig_value);
    sleep(5);
    printf("after: sig_value %d \n", sig_value);
}
int main(void)
{
    struct sigaction act, old;
    memset(&act, 0, sizeof(act));
    act.sa_handler = func;
    // `SA_NODEFER`: 在信号处理函数执行期间，
    // 同一个信号设置可以再次被触发
    act.sa_flags = SA_NODEFER;

    sigaction(SIGINT, &act, &old);

    while(1);
    return 0;
}

